<template>
	<view class="content">
		<view>
			<p>姓名：{{submitForm.name}}</p>
			<p>主播名：{{submitForm.age}}</p>
			<p>手机号：{{submitForm.telephone}}</p>
		</view>
		<view>行业经历：
			<text style="word-break:break-all;">{{submitForm.industry_experience}}</text>
		</view>
		<view>作品名称:{{submitForm.title}}</view>
		<view>比赛作品
			<player :current ="submitForm" />
		</view>
		 
	</view>
</template>

<script>
	import submitForm from "@/api/submitForm.js"
	import player from "@/components/player/player.vue"
	export default {
		components:{
			player
		},
		data() {
			return {
				racetracks:[],
				submitForm:{}
			}
		},
		async onLoad(e){
			//打印传递的参数
			this.registrationId = e.id
			//获取用户openid存储一下
			this.tokenOpenid = uni.getStorageSync("token_openid");
			//获取此用户已经报名过的信息
			await this.userRegistrationInformation()
			//获取赛道信息
			await this.getRegistrationRacetrack()
		},
		methods: {
			userRegistrationInformation(){
				//获取报名信息
				const data = {
					id:this.registrationId,
					openId:this.tokenOpenid
				}
				submitForm.get_user_registration_info(data).then(res=>{
					if(res.code == 200){
						console.log(res.data)
						this.submitForm = res.data
						this.submitForm.title = this.submitForm.title.toString()
					}
				})
			},
			//获取赛道信息
			getRegistrationRacetrack(){
				submitForm.get_registration_racetrack().then(res=>{
					const racetracks = [{}]
					res.data.forEach((item,index)=>{
						this.racetracks.push({"text":item.raceTrackName,"value":item.id})
					})
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.content{
		margin: 60rpx 70rpx;
		font-size: 40rpx;
		color: rgb(127,139,152);
		view{
			margin: 40rpx 0;
		}
	}
</style>
